home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-23 | 1.2 KB | 20 lines | [TEXT/MPS ] |
- # assert.pl
- # tchrist@convex.com (Tom Christiansen)
- #
- # Usage:
- #
- # &assert('@x > @y');
- # &assert('$var > 10', $var, $othervar, @various_info);
- #
- # That is, if the first expression evals false, we blow up. The
- # rest of the args, if any, are nice to know because they will
- # be printed out by &panic, which is just the stack-backtrace
- # routine shamelessly borrowed from the perl debugger.
-
- sub assert {
- &panic("ASSERTION BOTCHED: $_[0]",$@) unless eval $_[0];
- }
-
- sub panic {
- select(STDERR);